<template>
	<div style="margin-top: 40px;">
		<!-- <div v-show="classify">
			<div class="font-26">发布商品</div>
			<hr />
			<div>
				<div class="row" >
					<el-select v-model="form.storeGoodDto.goodOneCate" style="width: 200px;" @change="selectSort2()" placeholder="一级分类">
						<el-option :label="item.cateName" :value="item.cateId" :key="item.cateId" v-for="item in sortList"></el-option>
					</el-select>
					<div style="margin-left: 50px;"></div>
					<el-select v-model="form.storeGoodDto.goodTwoCate" style="width: 200px;" @change="selectSort3()" placeholder="二级分类">
						<el-option :label="item.cateName" :value="item.cateId" :key="item.cateId" v-for="item in secondList"></el-option>
					</el-select>
					<div style="margin-left: 50px;"></div>
					<el-select v-model="form.storeGoodDto.goodThreeCate" style="width: 200px;" placeholder="三级分类" @change="fenlei_name()">
						<el-option :label="item.cateName" :value="item.cateId" :key="item.cateId" v-for="item in ThirdList"></el-option>
					</el-select>
				</div>

				<el-button style="margin-top: 300px;margin-left: 260px;" type="primary" @click="confirm">确认发布该商品</el-button>


			</div>
		</div> -->
		<!-- <div >22222222</div> -->
		<div style="width: 86%;">
			<!-- 类目 -->
			<div>
				<div class="font-26" style="margin-bottom: 15px;font-size: 20px;">商品基本信息</div>
				<!-- <div class="border font20 marg-20 wai_pad">当前类目：{{fenlei1}}>>{{fenlei2}}>>{{fenlei3}}</div> -->
				<div class=" row " style="padding: 20px;background-color: #FFFFFF;">
					<span style="line-height: 36px;">当前类目：</span>
					<el-select v-model="form.storeGoodDto.goodOneCate" style="width: 200px;" @change="selectSort2()" placeholder="一级分类">
						<el-option :label="item.cateName" :value="item.cateId" :key="item.cateId" v-for="item in sortList"></el-option>
					</el-select>
					<div style="margin-left: 50px;"></div>
					<el-select v-model="form.storeGoodDto.goodTwoCate" style="width: 200px;" @change="selectSort3()" placeholder="二级分类">
						<el-option :label="item.cateName" :value="item.cateId" :key="item.cateId" v-for="item in secondList"></el-option>
					</el-select>
					<div style="margin-left: 50px;"></div>
					<el-select v-model="form.storeGoodDto.goodThreeCate" style="width: 200px;" placeholder="三级分类" @change="fenlei_name()">
						<el-option :label="item.cateName" :value="item.cateId" :key="item.cateId" v-for="item in ThirdList"></el-option>
					</el-select>
				</div>
			</div>
			<!-- 商品基本信息 -->
			<div class="bgcorlor marg-20" style="margin-bottom: 20px;">
				<div class="font20" style="padding: 20px;border-bottom: 1px solid#BABABA;">商品基础信息</div>
				<div class="wai_pad">
					<div>
						<div class="row">
							<div style="width: 100px;">*商品标题：</div>
							<el-input v-model="form.storeGoodDto.goodName" placeholder="最多允许输入30个汉字(60个字符)" :maxlength='30' style="width: 800px;margin-left: 10px;font-size: 16px;"></el-input>
						</div>
						<div style="font-size: 15px;margin-top: 10px;margin-bottom: 20px;color: #8a8a8a;margin-left: 110px;">*标题和描述关键词不可存在非法或敏感词汇，严重违规者封店处理</div>
					</div>
					<div style="width: 100%;" class="row">
						<div style="width: 100px;">*产品参数：</div>
						<div style="border:1px solid#BABABA;background: #FBF9FE;padding: 40px 40px 50px;margin-left: 10px;width: calc(90% - 100px);">
							<div style="display: flex;justify-content: flex-start;flex-wrap: wrap;">
								<div v-for="(item,index) in storeGoodParamDtos" :key="index" class="productSku">
									<el-input v-model="item.paramKey" placeholder="例如材质" style="width: 100px;"></el-input>
									<el-input v-model="item.paramName" placeholder="例如参数值" style="width: 100px;"></el-input>
									<el-button type="danger" style="margin-left: 10px;" @click.prevent="delTexture(index,storeGoodParamDtos)">删除
									</el-button>
									<el-button type="primary" @click.prevent="addTexture()" v-if="index==0">新增
									</el-button>
								</div>
							</div>
						</div>
						<!-- 	<div style="border:1px solid#BABABA;background: #FBF9FE;padding: 40px;margin-left: 10px;">
							<div class="row">
								<div class="row">
									<div>货号：</div>
									<el-input v-model="code" class="input_page"></el-input>
								</div>
								<div class="row">
									<div class="margl100">品牌：</div>
									<el-input v-model="brand" class="input_page"></el-input>
								</div>
							</div>
							<div class="row" style="margin-top: 15px;">
								<div class="row">
									<div>材质：</div>
									<el-input v-model="material" class="input_page"></el-input>
								</div>
								<div class="row">
									<div class="margl100">功能：</div>
									<el-input v-model="func" class="input_page"></el-input>
								</div>
							</div>
							<div class="row" style="margin-top: 15px;">
								<div class="row">
									<div>产地：</div>
									<el-input v-model="place" class="input_page"></el-input>
								</div>
								<div class="row">
									<div class="margl100">重量：</div>
									<el-input v-model="weight" class="input_page"></el-input>
								</div>
							</div>
						</div> -->
					</div>
				</div>
			</div>
			<!-- 销售信息 -->
			<div class="bgcorlor marg-20" style="margin-bottom: 20px;">
				<div>
					<div class="font20" style="padding: 20px;border-bottom: 1px solid#BABABA;">销售信息</div>
					<div class="row marg-20">
						<div class="newjust mar_l20" style="width: 100px;text-align: left;">*商品规格：</div>
						<el-select v-model="sku_spec" style="width: 200px;margin-left: 10px;" @change="select()">
							<el-option :value="item" :label="item.spuName" v-for="item in sku_spec_array"></el-option>
						</el-select>

						<el-button style="margin-left: 20px;" class="btn btn-primary" @click.prevent="addSize()" type="primary">前往新增规格</el-button>
					</div>
					<div class="row marg-20">
						<div class="newjust mar_l20" style="width: 100px;text-align: left;">起售价：</div>
						<el-input style="width: 200px;margin-left: 10px;" :maxlength="8" v-model="form.storeGoodDto.goodPrice"></el-input>
						<div class="newjust mar_l20" style="width: 100px;text-align: left;" v-if="appDate=='1'">供货价：</div>
						<el-input style="width: 200px;margin-left: 10px;" :maxlength="8" v-if="appDate=='1'" v-model="form.storeGoodDto.goodDiscountPrice"></el-input>
						<div class="newjust mar_l20" style="width: 100px;text-align: left;">补贴比例：</div>
						<!-- <el-select  style="width: 100px;">
								<el-option :label="goodItem.text" :value="goodItem.value" v-for="goodItem in proportion"></el-option>{{ goodItem.text }}
							</el-select> -->
						<el-select v-model="form.storeGoodDto.goodRatio" style="width: 200px;" placeholder="一级分类">
							<el-option :label="item.text" :value="item.value" :key="item.value" v-for="item in scalePublicData"></el-option>
						</el-select>
						<div v-if="storeId == 'store0000000021'" style="margin-left: 20px;" class="just mar_l20 font-17">是否创客商品</div>
						<el-radio v-if="storeId == 'store0000000021'" label="2" v-model="form.storeGoodDto.goodIdent" style="margin-left: 10px;margin-top: 5px;">是</el-radio>
						<el-radio v-if="storeId == 'store0000000021'" label="1" v-model="form.storeGoodDto.goodIdent" style="margin-top: 5px;">否</el-radio>
					</div>
					<div>
						<!-- 		<div class="row" style="margin-top: 10px;padding: 0 20px;">
							<div>起售价</div>
							<el-input style="width: 200px;" v-model="form.storeGoodDto.goodPrice"></el-input>
						</div> -->
						<!-- 		<div class="row" style="margin-top: 10px;">
							<div>优惠价（元）</div>
							<el-input style="width: 200px;" v-model="form.storeGoodDto.goodDiscountPrice"></el-input>
						</div> -->

					</div>
					<!-- 		<div class="row mar_l20" style="margin-top: 20px;">
						<div class="font-17">启用优惠价</div>
						<el-radio label="1" v-model="form.storeGoodDto.goodIsDiscount" style="margin-left: 10px;margin-top: 5px;">启用</el-radio>
						<el-radio label="2" v-model="form.storeGoodDto.goodIsDiscount" style="margin-top: 5px;">不启用</el-radio>
						<div v-if="storeId == 'store0000000021'" style="margin-left: 20px;" class="just mar_l20 font-17">是否创客商品</div>
						<el-radio v-if="storeId == 'store0000000021'" label="2" v-model="form.storeGoodDto.goodIdent" style="margin-left: 10px;margin-top: 5px;">是</el-radio>
						<el-radio v-if="storeId == 'store0000000021'" label="1" v-model="form.storeGoodDto.goodIdent" style="margin-top: 5px;">否</el-radio>
					</div> -->
					<div>
						<div style="clear: both;padding-top: 15px;"></div>
						<div class="form-group" v-for="(item, index) in option_array" style="clear: both;margin-left: 40px;" @change="generate">
							<label style="font-weight: bold;font-size: 16px;">{{item.spuName}}：</label>
							<div>
								<el-checkbox-group style="display: inline-block;" v-model="item.type_tag">
									<el-checkbox :label="val.spuName" v-for="val in item.goodSpuWebSecDtos"></el-checkbox>
								</el-checkbox-group>
								<button class="btn btn-default btn-sm" style="margin-left: 15px;" @click.prevent="delOption(index)">删除
								</button>
							</div>
						</div>
					</div>
					<div style="padding: 0 25px;">
						<div class="box-body no-padding" style="clear: both;padding-top: 15px;">
							<!-- <label  style="font-size: 18px;">商品规格</label> -->
							<table class="table">
								<thead>
									<tr>
										<th>缩略图</th>
										<th v-for="item in option_array">
											{{item.spuName}}
										</th>
										<th>价格</th>
										<th v-if="appDate=='1'">供货价</th>
										<th>库存</th>
										<th>补贴比例</th>
									</tr>
								</thead>
								<tbody class="spec-table">

									<tr v-for="(item,index) in form.goodSkuWebDtos">
										<td style="width: 100px;">
											<we-ui-uploads :images="item.skuIcon" :maxCount="1" :maxSize="1024*1024" @uploading="uploading"></we-ui-uploads>
										</td>
										<td v-for="val in item.goodSkuWebSecDtos">
											{{val.spuName}}
										</td>
										<td>
											<el-input style="width: 100px;" type="text" v-model="item.skuPrice" @blur="checkNum(item)" :maxlength="8"></el-input>
										</td>
											<td v-if="appDate=='1'">
											<el-input style="width: 100px;" type="text" v-model="item.skuDiscountPrice" @blur="checkNum1(item)" :maxlength="8"></el-input>
										</td>
										<td>
											<el-input style="width: 100px;" type="text" v-model="item.skuStock" :maxlength="5" @blur="checkNum2(item)"></el-input>
										</td>
										<td>
											<el-select v-model="item.skuRatio" style="width: 100px;">
												<el-option :label="item.text" :value="item.value" v-for="item in scalePublicData"></el-option>{{ item.text }}
											</el-select>
										</td>

										<td>
											<!-- <el-button size="small" type="danger" @click.native.prevent="deleteRow(index, form.standardInfoIdPojos)">删除</el-button> -->
										</td>
									</tr>
								</tbody>
							</table>
						</div>
					</div>
				</div>
			</div>
			<!-- 图文描述 -->
			<div class="bgcorlor font20 marg-20">
				<!-- <div class="border font20 marg-20 wai_pad">图文描述：</div> -->
				<div class="font20" style="padding: 20px;border-bottom: 1px solid#BABABA;">图文描述</div>
				<div class="wai_pad">
					<div class="row">
						<div class="font-17  marg-20" style="width: 110px;">商品缩略图：</div>

						<we-ui-uploads :images="form.storeGoodDto.goodCover" :maxCount="1" :maxSize="1024*1024" @uploading="uploading6"></we-ui-uploads>

					</div>
					<span style="font-size: 12px;color: #8A8A8A;display: block;margin-left: 124px;"> (尺寸:1:1,340*340) </span>
					<div class="row">
						<!-- &nbsp; &nbsp; -->
						<div class="font-17  marg-20" style="width: 110px;"> 商品轮播：</div>
						<we-ui-uploads :images="form.storeImgDtos" :maxCount="5" :maxSize="1024*1024" :isSort="true" @uploading="uploading2"></we-ui-uploads>
					</div>
					<span style="font-size: 12px;color: #8A8A8A;display: block;margin-left: 117px;">（尺寸:1:1,750*750,最多5张）</span>
					<div class="row font-15 marg-20">
						<div style="color: royalblue;margin-left: 123px;">重要提示：</div>
						<div style="font-size: 12px;color: #8A8A8A;line-height: 24px;">图片大小不可超过1M；850*850以上图片浏览效果更佳！</div>
					</div>
					<div class="row">
						<div class="font-17  marg-20" style="width: 110px;">商品详情：</div>
						<div style="max-width: 1000px;">
							<we-ui-uploads :images="form.storeImgDtoList" :maxCount="150" :maxSize="1024*1024" :isSort="true" @uploading="uploading3"></we-ui-uploads>
						</div>

					</div>
					<span style="font-size: 12px;color: #8A8A8A;display: block;margin-left: 120px;">（最多150张）</span>
				</div>
			</div>
			<!-- 支付信息 -->
			<div class="bgcorlor font20 marg-20">
				<div class="border_b font20 marg-20 wai_pad">支付信息</div>
				<div class="row wai_pad">
					<div class=" font-17">付款方式：</div>
					<el-radio-group v-model="radio" style="padding-left: 20px;display: flex;justify-content: center;align-items: center;margin-top: 5px;">
						<el-radio :label="1">一口价</el-radio>
						<!-- <el-radio :label="2">自定义邮费</el-radio>    -->
					</el-radio-group>
					<!-- 	<el-radio style="padding-left: 20px;display: flex;justify-content: center;align-items: center;margin: 0px;"
					 v-model="radio" label="1">一口价</el-radio> -->
				</div>
			</div>
			<!-- 物流信息 -->
			<div class="bgcorlor font20 marg-20">
				<div class="border_b font20 marg-20 wai_pad">物流信息</div>
				<div class="row  wai_pad">
					<div class="font-17">物流配送：</div>
					<el-radio-group v-model="wuliu" style="padding-left: 20px;display: flex;justify-content: center;align-items: center;margin-top: 5px;">
						<el-radio :label="1">包邮</el-radio>
						<!-- <el-radio :label="2">自定义邮费</el-radio>    -->
					</el-radio-group>
				</div>
				<!-- 自定义邮费显示 -->
				<div class="row mar_t20 mar_b20" v-show="wuliu==2">
					<div class="row marg-20 font-17 mar_l20">
						<div class="just">默认邮费</div>
						<el-input style="width: 100px;padding: 0px 15px 0 15px;"></el-input>
						<div class="just">元</div>
					</div>
					<div class="row marg-20" style="margin-left: 70px;">
						<div class="just">偏远地区邮费</div>
						<el-input style="width: 100px;padding: 0px 15px 0 15px;"></el-input>
						<div class="just">元</div>
						<div class="just" style="margin-left: 50px;">偏远地区邮费（新疆、西藏等地区）</div>
					</div>
				</div>
			</div>
			<!-- 支付信息 -->
			<div class="bgcorlor font20 marg-20">
				<div class="border_b font20 marg-20  wai_pad">售后服务</div>
				<div class="row wai_pad" style="padding-left: 5px;">
					<div class="just font-17 mar_l20">售后服务：</div>
					<el-checkbox-group v-model="checkList" style="margin-top: 5px;margin-left:20px;">
						<el-checkbox label="1">提供发票</el-checkbox>
						<el-checkbox label="2">退换货承诺:该商品支持【七天退换】服务</el-checkbox>
					</el-checkbox-group>
				</div>
				<div class="row" style="padding-left: 25px;padding-bottom: 25px;">
					<div class=" font-17 ">上架时间：</div>
					<el-radio-group v-model="form.storeGoodDto.goodState" style="padding-left: 20px;display: flex;justify-content: center;align-items: center;margin-top: 5px;">
						<el-radio label="2" v-model="form.storeGoodDto.goodState">立即上架</el-radio>
						<el-radio label="3" v-model="form.storeGoodDto.goodState">放入仓库</el-radio>

						<!-- <el-radio :label="2">自定义邮费</el-radio>    -->
					</el-radio-group>

				</div>
			</div>
			<div class="just mar_t50 mar_b50 " style="padding: 20px;">
				<el-button type="primary" :loading="loading" style="width: 300px;height: 50px;" @click="submitForm()">提交商品信息</el-button>
			</div>

		</div>
	</div>
	<!--   <el-form :model="form"
                     style="background-color: #FFFFFF;padding-top:10px;height: 100%;margin-top: 10px;padding-left: 10px;"
                     label-width="150px">
            
                
                <el-form-item label="商品名称：">
                    <el-input style="width: 405px;" v-model="form.storeGoodDto.goodName" :maxlength="50"></el-input>
                </el-form-item>
                <el-form-item label="起售价（元）：">
                    <el-input style="width: 200px;" v-model="form.storeGoodDto.goodPrice" ></el-input>
                </el-form-item>
                <el-form-item label="优惠价（元）：">
                    <el-input style="width: 200px;" v-model="form.storeGoodDto.goodDiscountPrice" ></el-input>
                </el-form-item>
                 <el-form-item label="启用优惠价：">
                        <el-radio class="radio" label="1" v-model="form.storeGoodDto.goodIsDiscount" style="margin: 0">启用</el-radio>
                        <el-radio class="radio" label="2" v-model="form.storeGoodDto.goodIsDiscount">不启用</el-radio>
                </el-form-item>
                <el-form-item label="补贴比例：">
                    <el-select v-model="form.storeGoodDto.goodRatio" style="width: 200px;margin-right: 30px;">
                        <el-option :label="item.text" :value="item.value" v-for="item in proportion"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="产品参数：">
                     <div v-for="(item,index) in storeGoodParamDtos">
                         <el-input v-model="item.paramKey" placeholder="例如材质" style="width: 100px;"></el-input>
                         <el-input v-model="item.paramName" placeholder="例如参数值" style="width: 100px;margin-bottom: 15px;"></el-input>
                         <button class="btn btn-default btn-sm" style="margin-left: 15px;"
                                @click.prevent="delTexture(index,storeGoodParamDtos)" >删除
                        </button>
                         <button class="btn btn-default btn-sm" style="margin-left: 15px;"
                                @click.prevent="addTexture()" v-if="index==0">新增
                        </button>
                     </div>
                </el-form-item>
                <hr>
                <el-form-item label="商品规格：">
                    <el-select v-model="sku_spec" style="width: 200px;" @change="select()">
                        <el-option :value="item" :label="item.spuName" v-for="item in sku_spec_array"></el-option>
                    </el-select>
                    <button class="btn btn-primary"@click.prevent="addSize()">前往新增规格</button>
                </el-form-item>
                <div style="clear: both;padding-top: 15px;"></div>
                <div class="form-group" v-for="(item, index) in option_array" style="clear: both;" @change="generate">
                    <label style="font-weight: bold;font-size: 16px;">{{item.spuName}}：</label>
                    <div>
                        <el-checkbox-group style="display: inline-block;" v-model="item.type_tag">
                            <el-checkbox :label="val.spuName"
                                         v-for="val in item.goodSpuWebSecDtos" ></el-checkbox>
                        </el-checkbox-group>
                        <button class="btn btn-default btn-sm" style="margin-left: 15px;"
                                @click.prevent="delOption(index)" >删除
                        </button>
						
                    </div>
                </div>          
				   
				  <div class="box-body no-padding" style="clear: both;padding-top: 15px;">
                    <label style="font-size: 18px;">商品规格</label>
                    <table class="table table-striped">
                        <thead>
                        <tr>
                            <th>缩略图</th>
                            <th v-for="item in option_array">
                                {{item.spuName}}
                            </th>
                            <th>价格</th>
                            <th>库存</th>
                            <th>补贴比例</th>
                        </tr>
                        </thead>
                        <tbody class="spec-table">

                        <tr v-for="(item,index) in form.goodSkuWebDtos">
                            <td style="width: 100px;">
                                    <we-ui-uploads :images="item.skuIcon"
                                   :maxCount="1"
                                   :maxSize="1024*1024"
                                   @uploading="uploading"></we-ui-uploads>                                                                                          
                            </td>
                            <td v-for="val in item.goodSkuWebSecDtos">
                                {{val.spuName}}
                            </td>
                            <td>                              
								 <el-input style="width: 100px;" type="text" v-model="item.skuPrice" @blur="checkNum(item)" :maxlength="8"></el-input>
                            </td>
                            <td>
                                <el-input style="width: 100px;" type="text" v-model="item.skuStock" @blur="checkNum2(item)"></el-input>
                            </td>
                            <td>
                                <el-select v-model="item.skuRatio"   style="width: 100px;">
                                    <el-option :label="item.text" :value="item.value"
                                               v-for="item in proportion"></el-option>{{ item.text }}
                                </el-select>
                            </td>  
							
                              <td>
                                <el-button
                                size="small"
                                type="danger"
                                @click.native.prevent="deleteRow(index, form.standardInfoIdPojos)">删除</el-button>
                            </td>                                          
						  </tr>
                        </tbody>
                    </table>
                </div>  
				
             <el-form-item label="总库存：">
                    <span>{{ countAll() }}</span>
                </el-form-item>  
				 
                <el-form-item label="运费设置：">
                        <el-radio class="radio" label="1" v-model="form.storeGoodDto.goodIsFree" style="margin: 0">包邮</el-radio>  						                  					  
           </el-form-item>
                 <el-form-item label="商品状态：">
                        <el-radio class="radio" label="2" v-model="form.storeGoodDto.goodState" style="margin: 0">立即上架</el-radio>  						                    						
             </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="nextStep()" >下一步</el-button>
                </el-form-item>
            </el-form> -->


	<!--     <div v-if="!show">
            <el-row>
                <el-col :span="24">

                    <el-button
                            type="primary"
                            @click="show=true">返回
                    </el-button>
                    <span style="font-size: 15px;margin-left: 10px;">新增/编辑商品</span>
                </el-col>
            </el-row>
            <div class="type" style="margin-left: 30px;margin-top: 40px;">
                <div class="juxing ">商品基本信息</div>
                <div class="jiantou "></div>
            </div>
            <div class="type">
                <div class="juxing acitve">商品详细信息</div>
                <div class="jiantou jiantou_active"></div>
            </div>
            <el-form label-width="120px" class="demo-ruleForm" style="width: 90%;" :model="form">
                <el-form-item label="商品缩略图：" label-width="100px">
                    <we-ui-uploads :images="form.storeGoodDto.goodCover"
                                   :maxCount="1"
                                   :maxSize="1024*1024"
                                   @uploading="uploading"></we-ui-uploads>
                    （尺寸:1:1,340*340）
                </el-form-item>
                <el-form-item label="商品轮播图：" label-width="100px">
                    <we-ui-uploads :images="form.storeImgDtos"
                                   :maxCount="5"
                                   :maxSize="1024*1024"
                                   :isSort="true"
                                   @uploading="uploading2"></we-ui-uploads>
                    （尺寸:1:1,750*750,最多5张）
                </el-form-item>
                <el-form-item label="商品详情：" label-width="100px">
                    <we-ui-uploads :images="form.storeImgDtoList"
                                   :maxCount="150"
                                   :maxSize="1024*1024"
                                   :isSort="true"
                                   @uploading="uploading3"></we-ui-uploads>
                    （最多150张）
                </el-form-item>  
				
				
                  <el-form-item label="商品详情：">
                    <vue-editor :content="form.details" @onEditorChange="onEditorChange"></vue-editor>
                </el-form-item>  

            <el-form-item>
                    <el-button type="primary" :loading="loading" @click="submitForm()">提交</el-button>  
					
					
                    <!--<el-button @click="resetForm('ruleForm')">重置</el-button>-->


	<!--    </el-form-item>
            </el-form>
        </div> -->



</template>
<style>
	#app {
		font-size: 17px;
	}

	.margl100 {
		margin-left: 100px;

	}

	.input_page {
		width: 270px;
		margin-left: 5px;
	}

	.wai_pad {
		padding: 25px;

	}

	.marg-20 {
		margin-top: 20px;
	}

	.border {
		border: 1px solid#BABABA;
	}

	.select {
		display: flex;
		padding: 10px;
		margin-top: 50px;

	}

	.mar_left {
		margin-left: 300px;
	}

	.juxing {
		color: white;
		background-color: #BFD1DE;
		display: inline-block;
		position: relative;
		top: -12px;
		height: 32px;
		line-height: 30px;
		width: 70%;
		text-align: center;
		left: 4px;
	}

	.jiantou {
		width: 0;
		height: 0;
		border-top: 16px solid transparent;
		border-left: 40px solid #BFD1DE;
		border-bottom: 16px solid transparent;
		display: inline-block;
	}

	.type {
		display: inline-block;
		width: 30%;
	}

	.acitve {
		background-color: #7C93A7;

	}

	.jiantou_active {
		border-left: 40px solid #7C93A7;
	}

	td .weui-cell {
		padding: 0;
	}

	.table>tbody>tr>td,
	.table>tbody>tr>th,
	.table>tfoot>tr>td,
	.table>tfoot>tr>th,
	.table>thead>tr>td,
	.table>thead>tr>th {
		vertical-align: middle;
	}

	.bgcorlor {
		background-color: #FFFFFF;
	}

	.newjust {
		display: flex;
		/* justify-content: center; */
		align-items: center;
	}

	.productSku {
		width: 47%;
		margin-right: 20px;
		margin-top: 10px;
	}

	.productSku:nth-child(2n) {
		margin-right: 0;
		width: 47%;
		margin-top: 10px;
	}
</style>

<script>
	export default {
		data() {
			return {
				checkList: ['2'],
				radio1: '1',
				wuliu: 1,
				radio: 1,
				code: '',
				brand: '',
				material: '',
				func: '',
				place: '',
				weight: '',
				classify: true,
				loading: false,
				fenlei1: '',
				fenlei2: '',
				fenlei3: '',
				form: {
					storeImgDtos: [],
					storeImgDtoList: [],
					goodSkuWebDtos: [],
					goodSpuWebDtos: [],
					storeGoodDto: {
						storeId: '',
						goodId: '',
						goodName: '',
						goodOneCate: '',
						goodTwoCate: 'enveN0000000021',
						goodThreeCate: '',
						goodPrice: '',
						// goodDiscountPrice: '',
						goodIsDiscount: '2',
						goodIdent: '1',
						goodRatio: 0.08,
						goodIsFree: '1',
						goodIsStock: '1',
						goodState: '2',
						goodCover: []
					}

				},
				sortList: [],
				secondList: [],
				ThirdList: [],
				carriageList: [],
				proportion: [{
						text: '2%',
						value: 0.02
					}, {
						text: '4%',
						value: 0.04
					}, {
						text: '6%',
						value: 0.06
					},
					{
						text: '8%',
						value: 0.08
					}, {
						text: '10%',
						value: 0.1
					},
					{
						text: '12%',
						value: 0.12
					}, {
						text: '14%',
						value: 0.14
					},
					{
						text: '16%',
						value: 0.16
					}
				],
				sku_spec_array: [],
				sku_spec: '',
				option_array: [],
				type_tag: '1',
				show: true,
				flag: false,
				flag2: false,
				URL: URL,
				brandList: [],
				storeId: '',
				storeImgDtos: [],
				storeImgDtoList: [],
				imgDetailList: [],
				show_sed: '',
				storeGoodParamDtos: [{
					paramKey: '',
					paramName: ''
				}],
				firstVal: false,
				firstVal2: false,
				goodSkuWebDtos: [],
				type: '',
				appDate: ''
			}
		},
		created() {
			this.selectSort()
			this.fetchStandard()
			// this.fetchData2();
			this.appDate = JSON.parse(sessionStorage.getItem('permission')).appData
			this.storeId = JSON.parse(sessionStorage.getItem('permission')).storeId
			// console.log(this.storeId, '检测商铺id')
			this.form.storeGoodDto.storeId = JSON.parse(sessionStorage.getItem('permission')).storeId
			if (this.$route.params.id == 0) {
				this.form = {
					storeImgDtos: [],
					storeImgDtoList: [],
					goodSkuWebDtos: [],
					goodSpuWebDtos: [],
					storeGoodDto: {
						storeId: '',
						goodId: '',
						goodName: '',
						goodOneCate: '',
						goodTwoCate: '',
						goodThreeCate: '',
						goodPrice: '',
						// goodDiscountPrice: '',
						goodIsDiscount: '2',
						goodIdent: '1',
						goodRatio: 0.08,
						goodIsFree: '1',
						goodIsStock: '1',
						goodState: '2',
						goodCover: []
					}

				}

			} else {
				this.fetchData()
			}
			// keep 点击新增规格
			if (sessionStorage.getItem('keep') == 1) {
				sessionStorage.removeItem('keep')
			} else {
				this.option_array = []
				this.storeImgDtos = []
				this.storeImgDtoList = []
				this.form = {
					storeImgDtos: [],
					storeImgDtoList: [],
					goodSkuWebDtos: [],
					goodSpuWebDtos: [],
					storeGoodDto: {
						storeId: '',
						goodId: '',
						goodName: '',
						goodOneCate: '',
						goodTwoCate: '',
						goodThreeCate: '',
						goodPrice: '',
						// goodDiscountPrice: '',
						goodIsDiscount: '2',
						goodIdent: '1',
						goodRatio: 0.08,
						goodIsFree: '1',
						goodIsStock: '1',
						goodState: '2',
						goodCover: []
					}

				}
				this.firstVal = false
				this.firstVal2 = false
				this.storeGoodParamDtos = [{
					paramKey: '',
					paramName: ''
				}]
				this.show = true


			}

			// console.log(this.option_array, '')

		},

		mounted() {
			if (sessionStorage.getItem('sku') == '1') {
				this.classify = false
				sessionStorage.removeItem('sku')
			}
		},

		activated() {

		},

		watch: {


			// '$route': 'fetchData2',

			// 'storeGoodParamDtos': {
			// 	handler: function(newValue, oldValue) {
			// 		if (this.firstVal) {
			// 			this.firstVal = false
			// 		} else {
			// 			this.form.storeGoodParamDtos = newValue
			// 		}

			// 	},
			// 	deep: true,
			// },
			// 'form.goodSkuWebDtos': {
			// 	handler: function(newValue, oldValue) {
			// 		if (this.firstVal2) {
			// 			this.firstVal2 = false
			// 		} else {
			// 			this.goodSkuWebDtos = newValue
			// 		}
			// 	},
			// 	deep: true,
			// }
		},
		methods: {


			addSize() {
				//新增规格

				var fenlei = [{
						fenlei1: this.fenlei1
					},
					{
						fenlei2: this.fenlei2
					},
					{
						fenlei3: this.fenlei3
					}

				]

				sessionStorage.setItem('fenlei', JSON.stringify(fenlei))
				sessionStorage.setItem('storeGoodParamDtos', JSON.stringify(this.storeGoodParamDtos))
				sessionStorage.setItem('form', JSON.stringify(this.form))
				sessionStorage.setItem('option_array', JSON.stringify(this.option_array))
				this.$router.push('/mall/size_list/' + '1')
			},

			fetchData() {
				// alert(this.$route.params.id)

				this.dataApi.ajax('singleStoreGood', {
					goodId: this.$route.params.id
				}, res => {
					if (res.responseType === 'S') {
						this.option_array = []
						this.form = res
						this.form.storeGoodDto.goodTwoCate = res.storeGoodDto.goodTwoCate
						this.form.storeGoodDto.goodThreeCate = res.storeGoodDto.goodThreeCate
						// console.log(this.form.storeGoodDto,'1111')

						// console.log(this.form, 'form')
						for (var k in this.form.goodSkuWebDtos) {
							this.form.goodSkuWebDtos[k].skuIcon = [this.form.goodSkuWebDtos[k].skuIcon]
						}
						for (var k in res.goodSpuWebDtos) {
							var arr = []
							for (var j in res.goodSpuWebDtos[k].goodSpuWebSecDtos) {
								arr.push(res.goodSpuWebDtos[k].goodSpuWebSecDtos[j].spuName)
							}
							this.option_array.push({
								spuName: res.goodSpuWebDtos[k].spuName,
								spuId: res.goodSpuWebDtos[k].spuId,
								goodSpuWebSecDtos: res.goodSpuWebDtos[k].goodSpuWebSecDtos,
								type_tag: arr
							})
						}
						this.storeImgDtos = generateArr(res.storeImgDtos)
						this.storeImgDtoList = generateArr(res.storeImgDtoList)

						this.form.storeGoodDto.goodCover = [this.form.storeGoodDto.goodCover]
						for (var i = this.form.storeImgDtos.length - 1; i >= 0; i--) {
							this.form.storeImgDtos[i] = [this.form.storeImgDtos[i].imgUrl]
						}
						for (var i = this.form.storeImgDtoList.length - 1; i >= 0; i--) {
							this.form.storeImgDtoList[i] = [this.form.storeImgDtoList[i].imgUrl]
						}
						this.firstVal = true
						this.firstVal2 = true
						this.storeGoodParamDtos = res.storeGoodParamDtos
						delete this.form.storeGoodParamDtos
						this.show_sed = true



						// this.selectSort2()
						// this.selectSort3()
					}
				});
			},
			submitForm() {
				// 
				if (!this.form.storeGoodDto.goodTwoCate) {
					this.$message({
						type: 'warning',
						message: '请选择分类!'
					});
					return false;
				}
				if (!this.form.storeGoodDto.goodName) {
					this.$message({
						type: 'warning',
						message: '请填写商品名称!'
					});
					return false;
				}
				if (!this.form.storeGoodDto.goodPrice || !isFloat(this.form.storeGoodDto.goodPrice)) {
					this.$message({
						type: 'warning',
						message: '商品起售价不正确!'
					});
					return false;
				}
				// if (!this.form.storeGoodDto.goodDiscountPrice || !isFloat(this.form.storeGoodDto.goodDiscountPrice)) {
				// 	this.$message({
				// 		type: 'warning',
				// 		message: '商品优惠价不正确!'
				// 	});
				// 	return false;
				// }
				// if (parseFloat(this.form.storeGoodDto.goodDiscountPrice) > parseFloat(this.form.storeGoodDto.goodPrice)) {
				// 	this.$message({
				// 		type: 'warning',
				// 		message: '商品现价不能大于原价!'
				// 	});
				// 	return false;
				// }
				for (var i = 0; i < this.storeGoodParamDtos.length; i++) {
					if (!this.storeGoodParamDtos[i].paramName || !this.storeGoodParamDtos[i].paramKey) {
						this.showMsg('请填写完整产品参数', 'warning')
						return
					}
				}
				if (this.option_array.length == 0) {
					this.$message({
						type: 'warning',
						message: '请至少选择一种规格!'
					});
					return false;
				}
				if (this.form.goodSkuWebDtos.length == 0) {
					this.$message({
						type: 'warning',
						message: '请选择规格属性!'
					});
					return false;
				}
				for (var i = this.form.goodSkuWebDtos.length - 1; i >= 0; i--) {
					if (this.form.goodSkuWebDtos[i].skuIcon.length == 0) {
						this.$message({
							type: 'warning',
							message: '请上传缩略图!'
						});
						return
					}
				}
				// this.form.goodSkuWebDtos.forEach(item => {
				// 	if (item.skuPrice < this.form.storeGoodDto.goodPrice) {
				// 		this.$message({
				// 			type: 'warning',
				// 			message: '商品价格不能低于起售价!'
				// 		});
				// 		this.loading = true
				// 	}
				// })
				if(this.loading == true) {
					this.loading = false
					return
				}
				// if (this.form.storeGoodDto.goodCover.length == 0) {
				// 	this.$message({
				// 		type: 'warning',
				// 		message: '请上传商品缩略图!'
				// 	});
				// 	return false;
				// }

				// if (this.form.storeImgDtos.length == 0) {
				// 	this.$message({
				// 		type: 'warning',
				// 		message: '请上传商品轮播图!'
				// 	});
				// 	return false;
				// }

				// if (this.form.storeImgDtoList.length == 0) {
				// 	this.$message({
				// 		type: 'warning',
				// 		message: '请上传商品详情!'
				// 	});
				// 	return false;
				// }
				let data = generateObj(this.form)
				//删除没有选中的规格属性
				data.goodSpuWebDtos = this.option_array
				for (var i = this.option_array.length - 1; i >= 0; i--) {
					var arr = []

					for (var j = this.option_array[i].type_tag.length - 1; j >= 0; j--) {
						for (var k = this.option_array[i].goodSpuWebSecDtos.length - 1; k >= 0; k--) {
							if (this.option_array[i].goodSpuWebSecDtos[k].spuName == this.option_array[i].type_tag[j]) {
								arr.push(this.option_array[i].goodSpuWebSecDtos[k])
							}
						}
					}

					this.option_array[i].goodSpuWebSecDtos = arr
				}
				let storeGoodDto = generateObj(this.form.storeGoodDto)
				storeGoodDto.goodCover = storeGoodDto.goodCover + ''
				data.storeGoodDto = storeGoodDto
				if (this.goodSkuWebDtos.length != 0) {
					for (var i = data.goodSkuWebDtos.length - 1; i >= 0; i--) {
						data.goodSkuWebDtos[i].skuIcon = data.goodSkuWebDtos[i].skuIcon + ''
					}
				} else {
					// delete data.goodSkuWebDtos
				}

				//获取storeImgDtos图片列表的长宽
				var storeImgDtos = []
				for (var i = data.storeImgDtos.length - 1; i >= 0; i--) {
					for (var j = this.storeImgDtos.length - 1; j >= 0; j--) {
						if (this.storeImgDtos[j].imgUrl == data.storeImgDtos[i]) {
							storeImgDtos.push(this.storeImgDtos[j])
							break;
						}
					}
				}
				data.storeImgDtos = storeImgDtos.reverse()
				data.storeGoodParamDtos = this.storeGoodParamDtos

				//获取storeImgDtoList图片列表的长宽
				var storeImgDtoList = []
				for (var i = data.storeImgDtoList.length - 1; i >= 0; i--) {

					for (var j = this.storeImgDtoList.length - 1; j >= 0; j--) {
						if (this.storeImgDtoList[j].imgUrl == data.storeImgDtoList[i]) {
							storeImgDtoList.push(this.storeImgDtoList[j])
							break;
						}
					}
				}

				data.storeGoodDto.storeId = JSON.parse(sessionStorage.getItem('permission')).storeId
				data.storeImgDtoList = storeImgDtoList.reverse()
				this.loading = true
				var arr = []
				if(data.goodSkuWebDtos[0].goodSkuWebSecDtos.length == 0) {
					data.goodSpuWebDtos.forEach(item => {
						arr.push(item.type_tag)
					})
					var ret = this.doExchange(arr)
					for (var i = 0; i < ret.length; i++) {
						var proObj = {};
						var retArr = ret[i].split('|');
						proObj['goodSkuWebSecDtos'] = [];
						for (var y = 0; y < retArr.length; y++) {
							data.goodSkuWebDtos[i].goodSkuWebSecDtos.push({
								spuName: retArr[y]
							})
						}
					}
				}
				
				// console.log(data.goodSkuWebDtos,'重新编辑sku')
				if (this.$route.params.id == 0) {
					this.dataApi.ajax('addStoreGood', data, res => {
						if (res.responseType === 'S') {
							this.showMsg('新增成功')

							this.goBack()
							//this.$router.push('/mall/self_support')
						}
						this.loading = false
					});
				} else {
					this.dataApi.ajax('editStoreGood', data, res => {
						if (res.responseType === 'S') {
							this.$message({
								type: 'success',
								message: '编辑成功!'
							});

							this.goBack()
							//this.$router.push('/mall/self_support')
						}
						this.loading = false
					});
				}

			},
			fetchStandard() {
				this.dataApi.ajax('selectShopSpuList', null, res => {
					if (res.responseType === 'S') {
						this.sku_spec_array = res.shopSpuPojos
						// console.log(this.sku_spec_array, 'sku_spec_array')
					}
				});
			},
			delOption(index) {
				this.option_array.splice(index, 1)
				this.generate()
			},
			generate() {
				var option_array = this.option_array;
				var spec_array = this.form.goodSkuWebDtos = [];
				if (option_array.length <= 0)
					return false;

				var select = [];
				for (var i in option_array) {
					if (option_array[i].type_tag.length > 0) {
						select.push(option_array[i].type_tag);
					} else {
						return false;
					}

				}
				var ret = this.doExchange(select)
				for (var i = 0; i < ret.length; i++) {
					var proObj = {};
					var retArr = ret[i].split('|');
					proObj['goodSkuWebSecDtos'] = [];
					for (var y = 0; y < retArr.length; y++) {
						proObj['goodSkuWebSecDtos'].push({
							spuName: retArr[y]
						})

					}

					proObj['skuIcon'] = [];
					if(this.appDate == '1') {
						proObj['skuDiscountPrice'] = 0;
					}

					proObj['skuPrice'] = 0;
					proObj['skuStock'] = 0;
					proObj['skuRatio'] = this.form.storeGoodDto.goodRatio;

					spec_array.push(proObj);
				}
			},
			doExchange(doubleArrays) {

				var len = doubleArrays.length;

				if (len >= 2) {
					var len1 = doubleArrays[0].length;
					var len2 = doubleArrays[1].length;
					var newLen = len1 * len2;
					var temp = new Array(newLen);
					var index = 0;

					for (var i = 0; i < len1; i++) {
						for (var j = 0; j < len2; j++) {
							temp[index] = doubleArrays[0][i] + '|' + doubleArrays[1][j];
							index++;
						}
					}

					var newArray = new Array(len - 1);
					for (var i = 2; i < len; i++) {
						newArray[i - 1] = doubleArrays[i];
					}
					newArray[0] = temp;
					return this.doExchange(newArray);

				} else {
					return doubleArrays[0];
				}
			},
			select() {
				if (!this.sku_spec.spuId) {
					return false;
				}

				var arr = this.option_array;
				for (var i in arr) {
					if (arr[i].spuName === this.sku_spec.spuName) {
						this.sku_spec = ''
						return false;
					}
				}
				if (arr.length >= 5) {
					return false;
				}

				this.dataApi.ajax('selectShopSpuList', {
					spuId: this.sku_spec.spuId
				}, res => {
					//console.log(res.standardTagPojos)
					if (res.responseType === 'S') {
						this.option_array.push({
							spuName: this.sku_spec.spuName,
							spuId: this.sku_spec.spuId,
							goodSpuWebSecDtos: res.shopSpuPojos,
							type_tag: [],
						})
						this.generate()
						this.sku_spec = ''
					}
				});

			},
			confirm() {
				if (this.form.storeGoodDto.goodOneCate) {
					this.classify = false
					this.fenlei_name()
				} else {
					this.$message({
						message: '请选择商品分类',
						type: 'warning'
					});

				}

			},
			selectSort() {
				//一级列表
				this.dataApi.ajax('selectGoodCate', {
					cateState: '1'
				}, res => {
					if (res.responseType === 'S') {
						this.sortList = res.dtos
					}
				});

			},
			fenlei_name() {
				// this.secondList.forEach(item => {
				// 	if (item.cateId == this.form.storeGoodDto.goodTwoCate) {
				// 		this.fenlei2 = item.cateName
				// 		//获取二级分类名字		 
				// 	}

				// })
				this.ThirdList.forEach(item => {
					if (item.cateId == this.form.storeGoodDto.goodThreeCate) {
						this.fenlei3 = item.cateName
						//获取三级分类名字	
					}
				})
			},

			selectSort2() {
				//获取一级分类名称
				this.sortList.forEach(item => {
					if (item.cateId == this.form.storeGoodDto.goodOneCate) {
						this.fenlei1 = item.cateName
						// console.log(this.fenlei1, 'fenlei1')
					}
				})
				// 二级；列表
				if (this.show_sed) {
					this.form.storeGoodDto.goodTwoCate = this.form.storeGoodDto.goodTwoCate
					this.show_sed = false
				} else {
					this.form.storeGoodDto.goodTwoCate = ''
				}

				this.dataApi.ajax('selectGoodCate', {
					cateId: this.form.storeGoodDto.goodOneCate,
					cateState: '1'
				}, res => {

					if (res.responseType === 'S') {
						this.secondList = res.dtos


					}
				});


			},
			selectSort3() {
				//获取三级分类名称
				this.secondList.forEach(item => {
					if (item.cateId == this.form.storeGoodDto.goodTwoCate) {
						this.fenlei2 = item.cateName
						//获取二级分类名字		 
					}

				})
				this.dataApi.ajax('selectGoodCate', {
					cateId: this.form.storeGoodDto.goodTwoCate,
					cateState: '1'
				}, res => {
					if (res.responseType === 'S') {
						this.ThirdList = res.dtos
					}
				});
			},
			uploading(f) {
				this.loading = true
				this.dataApi.upload('FileUploadNotify/upload', f.file, res => {
					if (res.responseType == 'S') {
						f.images.splice(f.index, 1, res.filePath)
						this.storeImgDtoList.push({
							imgHeight: res.height,
							imgUrl: res.filePath,
							imgWidth: res.width
						})
						console.log(this.storeImgDtoList.imgUrl)
						this.loading = false
					}
				});
			},
			uploading6(f) {
				this.loading = true
				this.dataApi.upload('FileUploadNotify/upload', f.file, res => {

					if (res.responseType == 'S') {
						f.images.splice(f.index, 1, res.filePath)
						this.storeImgDtoList.push({
							imgHeight: res.height,
							imgUrl: res.filePath,
							imgWidth: res.width
						})
						this.loading = false
					}
				});
			},
			uploading2(f) {
				this.loading = true
				this.dataApi.upload('FileUploadNotify/upload', f.file, res => {

					if (res.responseType == 'S') {
						f.images.splice(f.index, 1, res.filePath)
						this.storeImgDtos.push({
							imgHeight: res.height,
							imgUrl: res.filePath,
							imgWidth: res.width
						})
						this.loading = false
					}
				});
			},
			uploading3(f) {
				this.loading = true
				this.dataApi.upload('FileUploadNotify/upload', f.file, res => {

					if (res.responseType == 'S') {
						f.images.splice(f.index, 1, res.filePath)
						this.storeImgDtoList.push({
							imgHeight: res.height,
							imgUrl: res.filePath,
							imgWidth: res.width
						})
						this.loading = false
					}
				});
			},

			deleteRow(index, rows) {
				// console.log(index)
				// console.log(rows)
				rows.splice(index, 1);
			},
			nextStep() {
				if (!this.form.storeGoodDto.goodTwoCate) {
					this.$message({
						type: 'warning',
						message: '请选择分类!'
					});
					return false;
				}
				if (!this.form.storeGoodDto.goodName) {
					this.$message({
						type: 'warning',
						message: '请填写商品名称!'
					});
					return false;
				}
				if (!this.form.storeGoodDto.goodPrice || !isFloat(this.form.storeGoodDto.goodPrice)) {
					this.$message({
						type: 'warning',
						message: '商品起售价不正确!'
					});
					return false;
				}
				// if (!this.form.storeGoodDto.goodDiscountPrice || !isFloat(this.form.storeGoodDto.goodDiscountPrice)) {
				// 	this.$message({
				// 		type: 'warning',
				// 		message: '商品优惠价不正确!'
				// 	});
				// 	return false;
				// }
				// if (parseFloat(this.form.storeGoodDto.goodDiscountPrice) > parseFloat(this.form.storeGoodDto.goodPrice)) {
				// 	this.$message({
				// 		type: 'warning',
				// 		message: '商品现价不能大于原价!'
				// 	});
				// 	return false;
				// }
				for (var i = 0; i < this.storeGoodParamDtos.length; i++) {
					if (!this.storeGoodParamDtos[i].paramName || !this.storeGoodParamDtos[i].paramKey) {
						this.showMsg('请填写完整产品参数', 'warning')
						return
					}
				}
				if (this.option_array.length == 0) {
					this.$message({
						type: 'warning',
						message: '请至少选择一种规格!'
					});
					return false;
				}
				if (this.form.goodSkuWebDtos.length == 0) {
					this.$message({
						type: 'warning',
						message: '请选择规格属性!'
					});
					return false;
				}
				for (var i = this.form.goodSkuWebDtos.length - 1; i >= 0; i--) {
					if (this.form.goodSkuWebDtos[i].skuIcon.length == 0) {
						this.$message({
							type: 'warning',
							message: '请上传缩略图!'
						});
						return
					}
				}


				this.show = false
			},
			countAll() {
				var all = 0
				for (var i = this.form.standardInfoIdPojos.length - 1; i >= 0; i--) {
					all = all + parseInt(this.form.standardInfoIdPojos[i].stock)

				}
				return all;
			},
			checkNum(item) {
				if (!isFloat(item.skuPrice)) {
					this.showMsg('价格只能输入正数', 'warning')
					item.skuPrice = 0
				} else {
					item.skuPrice = parseFloat(Math.abs(item.skuPrice))
				}

			},
			checkNum1(item) {
				if (!isFloat(item.skuDiscountPrice)) {
					this.showMsg('价格只能输入正数', 'warning')
					item.skuDiscountPrice = 0
				} else {
					item.skuDiscountPrice = parseFloat(Math.abs(item.skuDiscountPrice))
				}

			},
			checkNum2(item) {
				if (!isNumber(item.skuStock)) {
					this.showMsg('库存只能输入正整数', 'warning')
					item.skuStock = 0
				} else if (item.skuStock > 100000) {
					this.showMsg('库存不能大于十万', 'warning')
					item.skuStock = 0
				} else {
					item.skuStock = parseFloat(Math.abs(item.skuStock))
				}
			},
			addTexture() {
				this.storeGoodParamDtos.push({
					paramName: '',
					paramKey: ''
				})
			},
			delTexture(index, rows) {
				if (rows.length == 1) {
					this.showMsg('产品参数不能少于一条', 'warning')
					return
				}
				rows.splice(index, 1)
			}
		}
	}
</script>
